<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加题目到大题</title>
    <link rel="stylesheet" href="__PUBLIC__/BeginnerAdmin/plugins/layui/css/layui.css" media="all"/>

</head>
<body>
<!--弹出层编程-->
<!--添加大题号-->
<div id="isadd" class="layui-form">
    <br>
    <div style="width: 90%;">
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">显示顺序</label>
            <div class="layui-input-block">
                <input type="hidden" name="examquestnum" value="<{$examquestnum}>">
                <input id="sequence" name="sequence" type="number" placeholder="题目排序（数字）"
                       lay-verify="number" class="layui-input" value="<{$exam_question_number.sequence}>">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">题目说明</label>
            <div class="layui-input-block">
                <textarea id="TitleExplain" style="display: none;"><{$exam_question_number.title_explain|htmlspecialchars_decode}></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </div>
</div>
<script src="__PUBLIC__/BeginnerAdmin/plugins/layui/layui.js"></script>
<script src="__PUBLIC__/AmazeUI/assets/js/jquery-1.8.0.min.js"></script>
<script src="__PUBLIC__/editor/ckeditor.js"></script>
<script>
    CKEDITOR.replace('TitleExplain',
        {
            filebrowserImageUploadUrl: "<{:U('Topic/CKeditUpImage')}>",
            height: 200,
            allowedContent : false
        });
    function settime() {
        var index=parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    }

    layui.use(['layer', 'table', 'form'], function () {
        var layer = layui.layer, table = layui.table, form = layui.form;
        form.on('submit(demo1)', function (data) {
            $.post('Admin_TestQuestions_UpdataTitleNumber.html', {
                examquestnum: data.field.examquestnum
                , sequence: data.field.sequence
                , title_explain: CKEDITOR.instances.TitleExplain.getData()
            }, function (ret) {
                if (ret.code == 200) {
                    layer.msg('题目修改成功');
                    setTimeout('settime()', 1500);//延时执行，让人看得更清楚
                } else {
                    layer.alert(ret.msg);
                }
            }, 'json');
            return false;
        });
    });
</script>
</body>
</html>